/*
 * Created on 03/06/2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package br.ufal.tci.nexos.arcolive.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

/**
 * @author Marcio
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class MainWindow extends JFrame {

	private JMenu configurations;
	
	public MainWindow() {
	
		JMenuBar menu = new JMenuBar();
		
		//JMenu configurations = new JMenu("Configura??es Gerais");
		//JMenu servicesManager = new JMenu("Gerenciamento de Servi?os");
		//JMenu about = new JMenu("Sobre o LVS...");
		
		JMenu configurations = new JMenu("General Configurations");
		JMenu servicesManager = new JMenu("Services Management");
		JMenu about = new JMenu("About ArCoLIVE...");
		
		//JMenuItem connections = new JMenuItem("Configura??o de Conex?o");
		JMenuItem connections = new JMenuItem("Connections Configuration");
		connections.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				new ConnectionConfigurations();
			}
		});
		
		//JMenuItem servicesList = new JMenuItem("Lista de Servi?os");
		JMenuItem servicesList = new JMenuItem("Services List");
		servicesList.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				new ServicesManager();
			}
		});
		
		//JMenuItem startAllServices = new JMenuItem("Iniciar todos os servi?os");
		//JMenuItem stopAllServices = new JMenuItem("Parar todos os servi?os");
		
		JMenuItem startAllServices = new JMenuItem("Start all services");
		JMenuItem stopAllServices = new JMenuItem("Stop all services");
		
		configurations.add(connections);
		
		servicesManager.add(servicesList);
		servicesManager.add(startAllServices);
		servicesManager.add(stopAllServices);
		
		menu.add(configurations);
		menu.add(servicesManager);
		menu.add(about);
		
		setJMenuBar(menu);
		
        getContentPane().add(Desktop.getInstance().getDesktopPane());
        setTitle("ArCoLIVE Server Manager");
        setSize(500, 340);
        setVisible(true);
	}
	
	public static void main(String[] args) {
		new MainWindow();
	}
	
}